package domain;

import org.codehaus.jackson.JsonNode;

public class Agent extends JSONABLE{

	public static enum Type{
		SENIOR, JUNIOR, GURU;
	}
	
	public static enum Owner{
		ME, ENEMY;
	}
	
	public String agentId;
	
	public int coordinate;
	
	public String type;
	
	public String owner;
	
	public Integer earnedMoney=0;
	
	public Agent(JsonNode agentNode) {
		this.agentId = agentNode.get("agentId").asText();
		this.coordinate = agentNode.get("coordinate").asInt();
		this.type = agentNode.get("type").asText();
		this.owner = agentNode.get("owner").asText();
		
	
	}

	public boolean isOwn(){
		return "me".equals(this.owner);
	}
	
	public Type getType(){
		if("junios".equals(type))
			return Type.JUNIOR;
		else if("SENIOR".equals(type))
			return Type.SENIOR;
		else
			return Type.GURU;
		
	}
	
	
}
